package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.CloudNodeModeAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.scene.attr.OperateInstAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * <Description> <br>
 *
 * @author zhouJiao<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2022年2月21日 <br>
 * @since R9.0<br>
 * @see com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler <br>
 */
@Service
@AttrHandler(CloudNodeModeAttrHandler.class)
public class CloudNodeModeAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {

    @Autowired
    IQuerySceneInstService querySceneInstService;

    @Autowired
    OperateInstAttrService operateInstAttrService;

    @Override
    public void handle(KiteAttr attr, KiteInst inst, AttrData data) {
        // 当“端口QoS策略”为五级QoS时显示"银+"和"金+"
        if(KiteStringUtils.equals(attr.getValue(), "1_0000210")){ // 1_0000210 五级
            inst.getAttr("210004685").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_M);
            inst.getAttr("210004686").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_M);
        }else if(KiteStringUtils.equals(attr.getValue(), "1_0000209")){ // 1_0000209三级
            inst.getAttr("210004685").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_H);
            inst.getAttr("210004686").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_H);
        }
    }

    @Override
    public void handleStyle(KiteAttr attr, KiteInst inst, AttrData data) {

    }
}
